﻿
@using QDT.Common
@using QDT.Core
@using QDT.Core.Projects
@using QDT.MVC
@using QDT.Web
@using QDT.Web.Code
@model QDT.Core.Projects.Project
@{
    var agency = Html.F().GetAgency(Model.Parent.AgencyId);
    Layout = "~/Views/Shared/_Layout2.cshtml";
    var isLogin = QDTContext.Current.IsAuthenticated;
}
<script type="text/javascript">
   
    function switchtab(obj) {
        $(".selected").removeClass("selected");
        $('.' + obj).addClass("selected");
    }
</script>       
<div id="jm-touch">
    <div class="project-detail jm-tab">
        <div class="name">
            <span>@Model.Name</span>

        </div>
        <div class="subname">
                    
            @if (agency == null)
            {
                <span>资产抵押</span>
            }
            else
            {
                <span>@agency.SubName</span>
            }
        </div>
       <div class="hd" style="text-align: center;"><a href="javascript:void(0)" data-tab="detail" class="detail selected" onclick="switchtab('detail');">项目详情</a><a href="javascript:void(0)" data-tab="risk" class="risk" onclick="switchtab('risk')"> 投资记录</a><a href="javascript:void(0)" data-tab="repayments" class="repayments" onclick="switchtab('repayments')"> 还款计划</a></div>
        <div class="bd">
            <div class="detail tab selected" style="padding-bottom: 50px;">
                <div class="profit">
                    <div><span>年华收益%</span><strong>@Model.Rate</strong></div>
                    <div><span>融资金额（元）</span><strong>@Model.BorrowAmount.ToMoney()</strong></div>
                    <div><span>融资期限（月）</span><strong>@Model.RepayTime</strong></div>
                    <div class="clearfix"></div>
                    <div><span>可投金额（元）</span><strong>@Model.NeedMoney.ToMoney()</strong></div>
                    <div> <span>剩余时间</span>
                    
                     @if (Model.Status != ProjectStatus.Progress)
                            {
                             <strong data-left-time="0" class="deadline">0天0时0分</strong>
                            }
                     else
                     {
                            <strong data-left-time="0" class="deadline">@Model.StartTime.Value.AddDays(Model.Parent.EndDate).RemainTime()</strong>
                          
                      }
                      </div>
                    <div class="clearfix"></div>
                </div>
              
                <div class="more" style="display: none;">正在加载更多项目信息...</div>
                <h3>项目信息</h3>
                <div class="span6">
                    <dl class="dl-horizontal">
                        <dt> 融资企业 </dt>
                        <dd> @(string.IsNullOrWhiteSpace(Model.Parent.IndustryDetail) ? "" : Model.Parent.IndustryDetail)</dd>
                        <dt> 所属行业 </dt>
                        <dd> @Model.Parent.Industry </dd>
                       
                        <dt>借款总额</dt>
                        <dd>@Model.BorrowAmount.ToMoney()</dd>
                        <dt>借款期限</dt>
                        <dd>@Model.RepayTime<span>个月</span></dd>
                        <dt>年化利率</dt>
                        <dd>@Model.Rate.00%</dd>
                        <dt>资金用途</dt>
                        <dd>@Model.Parent.LoanPurpose</dd>
                        <dt>还款日</dt>
                        <dd><span>每月</span>@Model.Parent.SettleDay<span>日</span></dd>
                    </dl>
                      <div class="clearfix"></div>
                </div>
            
					<h3>企业简介</h3>
                <div class="span10">
                    <dl class="dl-horizontal">
							
                        <dd style="margin-left: 20%;line-height: 26px;">@Model.Parent.Description</dd>
							
                    </dl>
                </div>
              <div class="clearfix"></div>
            </div>
            <div class="risk tab">
                <div class="more" style="display: none;">正在加载风险控制信息...</div>
                <div id="RiskControl" style="text-align: center;">
                   @Html.Action("AllBidList", "Project", new { projectid = Model.ID })
                  
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="repayments tab">
                <div class="more" style="display: none;">正在加载还款计划...</div>
                @if (Model.Status == ProjectStatus.Repaying || Model.Status == ProjectStatus.Repaid)
                {
                    if (!Model.Rate.Equals(0.4))
                    {
                        @Html.Action("RepayList","Project", new { projectid = Model.ID})
                    }
                }
              
                <div class="clearfix"></div>
            </div>
              <div class="clearfix"></div>
        </div>
        <div class="clearfix"></div>

          <div class="invest-btn-c"><a href="@Url.Action("NewProject","Project",new{id=Model.ID})">投资</a></div>
      
	    <div class="invest-spacing">&nbsp;</div>
        <div class="invest-mask"></div>
    </div>
</div>

